package javabase.schoolwork.day6_6;

/**
 * @author fance
 * @date 18-6-6 下午3:04
 */
public class Info<T> {
    private T val;

    public Info(T val) {
        this.val = val;
    }

    public T getVal() {
        return val;
    }

    public void setVal(T val) {
        this.val = val;
    }

    @Override
    public String toString() {
        return "Info{" +
                "val=" + val +
                '}';
    }

    public static void main(String[] args) {
        Info<String> i1 = new Info<>("李小龙");
        Info<Object> i2 = new Info<>(new Object());
        fun1(i1);
        fun1(i2);

        Info<Integer> i3 = new Info<>(30);
        Info<Float> i4 = new Info<>(30.1f);
        fun2(i3);
        fun2(i4);


    }
    public static void fun1(Info<? super String> tmp) {
        System.out.println(tmp);
    }
    public static void fun2(Info<? extends Number> tmp) {
        System.out.println(tmp + ".. ");
    }
}
